home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 June / MACPOWER-1997-06.ISO.7z / MACPOWER-1997-06.ISO / AMUG / PROGRAMMING / BSDSoundLib 1.0.1.sit / BSDSoundLib dist / BSDSoundLib ƒ / BSDSoundLib.h < prev    next >
Text File  |  1997-01-21  |  2KB  |  93 lines

  1. /*
  2.      File:        BSDSoundLib.h
  3.  
  4.      Contains:    BSDSoundLib Headers.
  5.  
  6.      Version:    Technology:    Torture Chamber v1.0
  7.                  Package:    BSDSoundLib v1.0
  8.  
  9.      Copyright:    ゥ 1996, BuggySoftェ Development.
  10.                  By Scott Dunbar
  11. */
  12.  
  13. #ifndef __BSDSOUNDLIB_
  14. #define __BSDSOUNDLIB_
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20. #ifndef __SOUND__
  21. #include <Sound.h>
  22. #endif
  23.  
  24.     //    Use these with SetChanVol()
  25. #define kMaxLeft        -128    // left channel max; right channel min
  26. #define kMaxRight        128        // left channel min; right channel max
  27. #define kBalanced        0        // left & right channels equal
  28.  
  29. #define kMaxSndChans    25        // Maximum number of sound channels allowed
  30.  
  31. extern short    numChannels;    // total channels allocated
  32. extern Boolean    sndChanActive[kMaxSndChans], loopingActive;    // true if sound channel is active
  33.  
  34.  
  35.     //    InitSoundUtils();
  36.     //        Call before using any other routines from this library
  37. extern void InitSoundUtils (void);
  38.  
  39.     //    DisposeSoundUtils();
  40.     //        Call when finished using this library
  41. extern void DisposeSoundUtils (void);
  42.  
  43.     //    short chan = FindFreeChannel();
  44.     //        Use this to get the number of a free sound channel
  45. extern short FindFreeChannel (void);
  46.  
  47.     //    PlaySound(chanNum, snd);
  48.     //        Use this to play a sound on a certain channel
  49.     //    PlaySound(FindFreeChannel(), snd);
  50.     //        Use like that to play on any channel
  51. extern void PlaySound (short chanNum, Handle snd);
  52.  
  53.     //    PlaySnd(snd);
  54.     //        Use this to play a sound asyncrously.
  55. extern void PlaySnd (Handle snd);
  56.  
  57.     //    SilenceChannel(chanNum);
  58.     //        Use this to silence a sound channel
  59. extern void SilenceChannel (short chanNum);
  60.  
  61.  
  62.     //    SetChaneVol(chanNum, kMaxLeft);
  63.     //    SetChaneVol(chanNum, kBalanced);
  64.     //    SetChaneVol(chanNum, kMaxRight);
  65.     //        Use this to set the volume of a sound channel and for stereo effects (panning...etc.)
  66. extern void SetChanVol (short chanNum, short balance);
  67.  
  68.     //    BalanceSndChannels();
  69.     //        Use to reset the volume levels on all sound channels
  70. extern void BalanceSndChannels (void);
  71.  
  72.  
  73.     //    InitLoopingSounds();
  74.     //        Call before playing any looping sounds
  75. extern void InitLoopingSounds (void);
  76.  
  77.     //    DisposeLoopingSounds();
  78.     //        Call when finished playing looping sounds
  79. extern void DisposeLoopingSounds (void);
  80.  
  81.     //    PlayLoopingSound(snd);
  82.     //        Use this to start a sound looping
  83. extern void PlayLoopingSound (Handle snd);
  84.  
  85.     //    SilenceLoopingChannel();
  86.     //        Use this to stop a looping sound
  87. extern void SilenceLoopingChannel (void);
  88.  
  89. #ifdef __cplusplus
  90. }
  91. #endif
  92.  
  93. #endif